﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;

namespace MvcTemplates
{
    public abstract class MetadataAttribute : System.Attribute, IMetadataAware
    {
        public virtual void Process( ModelMetadata modelMetadata )
        {
        }

        public void OnMetadataCreated( ModelMetadata metadata )
        {
            Process( metadata );
            metadata.AdditionalValues[this.GetType().Name] = this;
        }
    }
}